package com.mars.basic.allmain.vo.menu;

import com.mars.basic.allmain.po.Menu;
import lombok.Data;

import java.util.Date;

/**
 * @author Marvrick
 */
@Data
public class MenuVo {

    private Integer id;

    private String module;

    private Integer pId;

    private String name;

    private String type;

    private String path;

    private String frontIndex;

    private String frontTitle;

    private String frontIcon;

    private Integer grade;

    private String status;

    private Double sort;

    private String identify;

    public Menu build() {

        Menu menu = Menu.builder()
                .updateTime(new Date())
                .grade(this.grade)
                .identify(this.identify)
                .status(this.status)
                .frontIndex(this.frontIndex)
                .frontIcon(frontIcon)
                .frontTitle(frontTitle)
                .name(name)
                .type(getType())
                .build();

        return menu;
    }


}
